from flask.app import Flask, request
from flask_cors import CORS
import config
from server.controller.yolo import yolo_api
from server.controller.register import register_api
from database import db



# from server.model.user import User
# from server.result.result import Result

app = Flask(__name__)
CORS(app)


# db = SQLAlchemy(app)

app.register_blueprint(yolo_api, url_prefix='/yolo')
app.register_blueprint(register_api, url_prefix='/register')

# app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:123456@localhost:3308/yolo'
# app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

app.config.from_object(config)

db.init_app(app)


if __name__ == '__main__':
    app.run(host="0.0.0.0", port=9999, debug=True)
